<%@page contentType="text/html;charset=utf-8" pageEncoding="utf-8" %>
<jsp:include page="head.jsp"></jsp:include>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>控制台</title>
    <link rel="stylesheet" type="text/css" href="../../statics/css/identify.css" />
    <link rel="stylesheet" type="text/css" href="../../statics/css/layout.css" />
    <link rel="stylesheet" type="text/css" href="../../statics/css/style.css" />
    <link rel="stylesheet" type="text/css" href="../../statics/css/control_index.css" />
    <script type="text/javascript" src="../../statics/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="../../statics/js/layer.js"></script>
    <script type="text/javascript" src="../../statics/js/haidao.offcial.general.js"></script>
    <script type="text/javascript" src="../../statics/js/select.js"></script>
    <script type="text/javascript" src="../../statics/js/haidao.validate.js"></script>
</head>

<style>
    a{
        color:#666; font-size:14px;
    }

</style>
<body>


<div class="view-body">
    <div class="view-product">
        <div class="info-center">
            <div class="manage-head">
                <h6 class=" padding-left manage-head-con ">车位新增</h6>
            </div>

            <div class="basic-info-detail clearfix">
                <div class="unit-style padding-big-lr clearfix">
                    <h4 class="real-name-head margin-large-top">车位信息<span class="margin-left <text-normal></text-normal>">请填写车位区域和车位号码</span></h4>
                    <form id="xzform">

                        <div class="real-name-con height-main margin-top-25 clearfix">
                            <p class="content-left-zoon">
                                车位区域
                            </p>
                            <div class="content-right-zoon">
                                <input class="width-main input" type="text" datatype="*" name="park_area" value="" required="required">
                            </div>
                        </div>
                        <div class="real-name-con margin-top-25 clearfix">
                            <p class="content-left-zoon">
                                车位号码
                            </p>
                            <div class="content-right-zoon">
                                <input class="width-main input" type="text" datatype="*" name="park_number" value="" required="required">
                            </div>
                        </div>

                    </form>
                    <div class="real-name-con margin-top-25">
                        <div class="margin-large-top padding-left text-left content-right-zoon">
                            <input type="button" value="新 增" class="submit fl" id = "insertowner" style="margin-left: 80px" >
                        </div>
                    </div>
                </div>
            </div>
            <div class="show-page padding-top-0 layout hidden">
                <ul class="tr-float">
                </ul>
            </div>
        </div>
    </div>

    <script>
        $("#insertowner").click(function () {
            $.ajax({
                type: "POST",
                url: "http://localhost:8888/ParkManage/insertParkPlace",
                data: $('#xzform').serialize(),// 你的formid
                async: false,
                success: function (data) {
                    if(data.isNull == true){
                        alert(data.mes)
                    }
                    if(data.success == true ){
                        $(".width-main input").val('');
                        alert(data.mes);
                    }else if(data.repeat == 1){
                        alert("该车位已经存在 请重填字段!");
                    }

                }
            });
        });

    </script>
</body>

</html>